; -- LimeReader.iss --
; LimeReader - 影谷长图处理大师 安装脚本
; 简化版本：参考 LoimReader 的简洁设计
;
; 支持命令行参数覆盖版本号：
; iscc LimeReader.iss /DAppVersion=2.8.0

#ifndef AppVersion
#define AppVersion "2.7.2"
#endif

[Setup]
AppId={{B5A28E2F-6E7C-4D8D-9E53-A9E4F0C2DB7D}}
AppName=LimeReader
AppVerName=影谷长图处理大师 {#AppVersion}
AppVersion={#AppVersion}
AppPublisher=影谷科技
AppPublisherURL=https://ctdy123.com
DefaultDirName={autopf}\LimeReader
DefaultGroupName=影谷长图处理大师
DisableProgramGroupPage=yes
OutputDir=installer
OutputBaseFilename=LimeReader-Setup-v{#AppVersion}
SetupIconFile=icons\windows.ico
Compression=lzma
SolidCompression=yes
ArchitecturesAllowed=x64
ArchitecturesInstallIn64BitMode=x64
UninstallDisplayIcon={app}\LimeReader.exe

[Languages]
Name: "schinese"; MessagesFile: "compiler:Languages\ChineseSimplified.isl"

[Files]
; 主程序文件 (try multiple locations)
Source: "build\LimeReader.exe"; DestDir: "{app}"; Flags: ignoreversion skipifsourcedoesntexist
Source: "build\Release\LimeReader.exe"; DestDir: "{app}"; Flags: ignoreversion skipifsourcedoesntexist
Source: "build\bin\Release\LimeReader.exe"; DestDir: "{app}"; Flags: ignoreversion
Source: "dist\bin\LimeReader.exe"; DestDir: "{app}"; Flags: ignoreversion skipifsourcedoesntexist

; 所有 DLL (try multiple locations)
Source: "build\*.dll"; DestDir: "{app}"; Flags: ignoreversion skipifsourcedoesntexist
Source: "build\Release\*.dll"; DestDir: "{app}"; Flags: ignoreversion skipifsourcedoesntexist
Source: "build\bin\Release\*.dll"; DestDir: "{app}"; Flags: ignoreversion skipifsourcedoesntexist
Source: "dist\bin\*.dll"; DestDir: "{app}"; Flags: ignoreversion skipifsourcedoesntexist

; Poppler DLLs from source directory
Source: "mingw64-poppler\bin\libpoppler-153.dll"; DestDir: "{app}"; Flags: ignoreversion skipifsourcedoesntexist
Source: "mingw64-poppler\bin\libpoppler-cpp-2.dll"; DestDir: "{app}"; Flags: ignoreversion skipifsourcedoesntexist
Source: "mingw64-poppler\bin\libpoppler-glib-8.dll"; DestDir: "{app}"; Flags: ignoreversion skipifsourcedoesntexist

; Qt Plugins - Platforms
Source: "build\platforms\*.dll"; DestDir: "{app}\platforms"; Flags: ignoreversion skipifsourcedoesntexist
Source: "build\Release\platforms\*.dll"; DestDir: "{app}\platforms"; Flags: ignoreversion skipifsourcedoesntexist
Source: "build\bin\Release\platforms\*.dll"; DestDir: "{app}\platforms"; Flags: ignoreversion skipifsourcedoesntexist
Source: "dist\bin\platforms\*.dll"; DestDir: "{app}\platforms"; Flags: ignoreversion skipifsourcedoesntexist

; Qt Plugins - Styles
Source: "build\styles\*.dll"; DestDir: "{app}\styles"; Flags: ignoreversion skipifsourcedoesntexist
Source: "build\Release\styles\*.dll"; DestDir: "{app}\styles"; Flags: ignoreversion skipifsourcedoesntexist
Source: "build\bin\Release\styles\*.dll"; DestDir: "{app}\styles"; Flags: ignoreversion skipifsourcedoesntexist
Source: "dist\bin\styles\*.dll"; DestDir: "{app}\styles"; Flags: ignoreversion skipifsourcedoesntexist

; Qt Plugins - Image Formats
Source: "build\imageformats\*.dll"; DestDir: "{app}\imageformats"; Flags: ignoreversion skipifsourcedoesntexist
Source: "build\Release\imageformats\*.dll"; DestDir: "{app}\imageformats"; Flags: ignoreversion skipifsourcedoesntexist
Source: "build\bin\Release\imageformats\*.dll"; DestDir: "{app}\imageformats"; Flags: ignoreversion skipifsourcedoesntexist
Source: "dist\bin\imageformats\*.dll"; DestDir: "{app}\imageformats"; Flags: ignoreversion skipifsourcedoesntexist

; Qt Plugins - Icon Engines
Source: "build\iconengines\*.dll"; DestDir: "{app}\iconengines"; Flags: ignoreversion skipifsourcedoesntexist
Source: "build\Release\iconengines\*.dll"; DestDir: "{app}\iconengines"; Flags: ignoreversion skipifsourcedoesntexist
Source: "build\bin\Release\iconengines\*.dll"; DestDir: "{app}\iconengines"; Flags: ignoreversion skipifsourcedoesntexist
Source: "dist\bin\iconengines\*.dll"; DestDir: "{app}\iconengines"; Flags: ignoreversion skipifsourcedoesntexist

; Qt Plugins - TLS
Source: "build\tls\*.dll"; DestDir: "{app}\tls"; Flags: ignoreversion skipifsourcedoesntexist
Source: "build\Release\tls\*.dll"; DestDir: "{app}\tls"; Flags: ignoreversion skipifsourcedoesntexist
Source: "build\bin\Release\tls\*.dll"; DestDir: "{app}\tls"; Flags: ignoreversion skipifsourcedoesntexist
Source: "dist\bin\tls\*.dll"; DestDir: "{app}\tls"; Flags: ignoreversion skipifsourcedoesntexist

; Translations
Source: "build\translations\*.qm"; DestDir: "{app}\translations"; Flags: ignoreversion skipifsourcedoesntexist
Source: "build\Release\translations\*.qm"; DestDir: "{app}\translations"; Flags: ignoreversion skipifsourcedoesntexist
Source: "build\bin\Release\translations\*.qm"; DestDir: "{app}\translations"; Flags: ignoreversion skipifsourcedoesntexist
Source: "dist\bin\translations\*.qm"; DestDir: "{app}\translations"; Flags: ignoreversion skipifsourcedoesntexist
Source: "translations\*.qm"; DestDir: "{app}\translations"; Flags: ignoreversion skipifsourcedoesntexist

; 资源文件
Source: "icons\*"; DestDir: "{app}\icons"; Flags: ignoreversion recursesubdirs skipifsourcedoesntexist
Source: "images\*"; DestDir: "{app}\images"; Flags: ignoreversion recursesubdirs skipifsourcedoesntexist

[Icons]
Name: "{autoprograms}\影谷长图处理大师"; Filename: "{app}\LimeReader.exe"; WorkingDir: "{app}"
Name: "{autodesktop}\影谷长图处理大师"; Filename: "{app}\LimeReader.exe"; WorkingDir: "{app}"; Tasks: desktopicon

[Tasks]
Name: "desktopicon"; Description: "创建桌面快捷方式"; GroupDescription: "附加选项:"; Flags: unchecked

[Run]
Filename: "{app}\LimeReader.exe"; Description: "运行 影谷长图处理大师"; Flags: nowait postinstall skipifsilent
